var list=document.querySelectorAll(".list");
var hwx=document.querySelectorAll(".hwx");
var weixin=document.querySelectorAll(".weixin");
var top1=document.querySelector(".top");
var bheight=0;
var seti;

window.addEventListener("scroll",function(){
	if(document.documentElement.scrollTop>600){
		top1.style.display="block"
	}else{
		top1.style.display="none";
	}
});
//返回顶部
top1.addEventListener("click",function(){
	bheight=document.documentElement.scrollTop;
	seti=setInterval(function(){
		bheight-=100;
		document.documentElement.scrollTop=bheight
		if(document.documentElement.scrollTop<=0){
			clearInterval(seti);
			console.log("ting");
		}
	},20);
});

for(let i=0;i<list.length;i++){
	if(list[i].children[0].children[0].childElementCount<6){
		list[i].children[1].style.display="none";
		list[i].children[2].style.display="none";
	}
	list[i].children[1].addEventListener("click",function(){
			if(list[i].children[0].children[0].style.left="-1140px");
			list[i].children[0].children[0].style.left="0";
		})
	list[i].children[2].addEventListener("click",function(){
		if(list[i].children[0].children[0].style.left="0px")
		list[i].children[0].children[0].style.left="-1140px";
	})
}

//显示微信二维码
for(let i=0;i<hwx.length;i++){
	hwx[i].addEventListener("mouseover",function(){
		weixin[i].style.display="block";
		getComputedStyle(weixin[i]).display;
		weixin[i].style.transition="all 2s";
		weixin[i].style.opacity="1";
		clearTimeout(clearT);
	})
	hwx[i].addEventListener("mouseout",function(){
		weixin[i].style.opacity="0";
		clearT=setTimeout(function(){
				weixin[i].style.display="none";
		},1000);
	})
}